<%@page isELIgnored="false" import="java.net.*" %>
<%@taglib prefix="tiles" uri="struts-tiles" %>
<%@taglib prefix="html" uri="struts-html" %>
<%@taglib prefix="c" uri="jstl" %>
<%@taglib prefix="mcfn" uri="mcfn" %>
<%@taglib prefix="fn" uri="jstl-fn" %>
					<div id="bodyContent">
						<h1> Materials of asset</h1>
                                                <br/>
                                                <c:if test="${result eq 1}">
                                                    Material removed
                                                    <br>    
                                                    <br>    
                                                </c:if>
                                                <c:if test="${result eq 2}">
                                                    Material(s) Added(s)
                                                    <br>    
                                                    <br>    
                                                </c:if>
                                                <table width="100%">
                                                    <tr>
                                                        <td>
                                                            <div onclick="location.href='${URLBase}Assets.do';" style="display: inline; color: blue; font-size: 12px;" onmouseover="this.style.textDecoration='underline';this.style.cursor='pointer';" onmouseout="this.style.textDecoration='none';this.style.cursor='default';" >Assets</div>
                                                            <div style="display: inline; color: black; font-size: 12px;" > >  ${nombre}</div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td width="70%" align='right'>
                                                            <html:hidden property="cveAsset" styleId="cveAsset" value="${Asset}" />
								<a href='AssetsMaterialesAgregar.do?cveAsset=${Asset}'>
									<img alt="Crear nuevo usuario" src="images/btnAdd.gif">
								</a>
                            				</td>
                                                    </tr>
                                                </table>                                                
                                                
<!--						<div class='errors'><html:errors/>${UserLogin.messageError}</div><br/>-->
<!--						<div style="text-align: right; width: 100%;">
<c:if test="${UserLogin.actualRoleId eq 2}">
						<span style="display: inline;" class="contentBtn"><a href="AssetsAlta.do"><img src="${URLBase}images/btnAdd.gif" /></a></span> &nbsp; 
						<span style="display: inline;" class="contentBtn"><a href="${URLBase}PreimplementacionEvento.do"><img src="images/btnPreimplementacion.gif" /></a></span>
</c:if>
						</div>-->
						<br/>
<c:set value="${fn:length(materiales)}" var="MaterialesLength" />
<c:choose>
<c:when test="${MaterialesLength eq 0}">
						<center>No records</center>
</c:when>
<c:otherwise>

                                                <html:form action="/Materiales" method="post" styleId="MaterialesForm">
                                                    <html:hidden property="cveForma" styleId="cveForma"  />
                                                    <html:hidden property="operacion" styleId="operacion" />
                                                    <html:hidden property="cveAsset" value="${Asset}" />
						</html:form>
    
                                             <table class="tabDatos">
							<thead>
								<tr>									
									<th>Materials of Asset </th>
									<th></th>
								</tr>
							</thead>
            
<c:forEach items="${materiales}" var="materiales" varStatus="materialStatuss"> 
    
							<tr>
                                                            <td><a href="GetMaterialesAsset.do?material=${materiales.archivoMaterial}">${materiales.archivoMaterial}</a></td>								
								<td align="center">
									<html:image src="images/btnEliminar.gif" onclick="document.getElementById('operacion').value=2;document.getElementById('cveForma').value=${materiales.cveMaterial};document.getElementById('MaterialesForm').submit( );" />
								</td>
							</tr>
</c:forEach>
                                                                                                        

                                                                                                        
						</table>
</c:otherwise>
</c:choose>
					</div>
					<div id="footContent"></div>